﻿<UserControl 
  x:Class="CrackNET.InjectedViewer.View.MemoryExplorer.SelectedObjectView"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:vw="clr-namespace:CrackNET.InjectedViewer.View.MemoryExplorer"
  Background="WhiteSmoke"
  >
  <UserControl.Resources>
    <GroupStyle x:Key="ListGroupStyle">
      <GroupStyle.ContainerStyle>
        <Style TargetType="{x:Type GroupItem}">
          <Setter Property="Margin" Value="2" />
          <Setter Property="Template">
            <Setter.Value>
              <ControlTemplate TargetType="{x:Type GroupItem}">
                <ControlTemplate.Resources>
                  <Style TargetType="{x:Type TextBlock}">
                    <Setter Property="FontWeight" Value="Bold" />
                    <Setter Property="FontSize" Value="13" />
                    <Setter Property="Margin" Value="1" />
                    <Setter Property="Padding" Value="0,2" />
                  </Style>
                </ControlTemplate.Resources>
                <DockPanel Background="{DynamicResource PrimaryBackgroundBrush}">
                  <Expander Background="Transparent" BorderBrush="LightGray" BorderThickness="0.5" IsExpanded="True">
                    <Expander.Header>
                      <StackPanel Orientation="Horizontal">
                        <TextBlock 
                          x:Name="txt" 
                          Padding="4,2"
                          Text="Instance Properties" 
                          />
                        <TextBlock Text="(" />
                        <TextBlock Text="{Binding Path=ItemCount, Mode=OneWay}" />
                        <TextBlock Text=")" />
                      </StackPanel>
                    </Expander.Header>
                    <Expander.Content>
                      <ItemsPresenter Margin="2" />
                    </Expander.Content>
                  </Expander>
                </DockPanel>
                <ControlTemplate.Triggers>
                  <DataTrigger Binding="{Binding Path=Name}" Value="2_field">
                    <Setter TargetName="txt" Property="Text" Value="Instance Fields" />
                  </DataTrigger>
                  <DataTrigger Binding="{Binding Path=Name}" Value="3_collectionItem">
                    <Setter TargetName="txt" Property="Text" Value="Collection Items" />
                  </DataTrigger>
                </ControlTemplate.Triggers>
              </ControlTemplate>
            </Setter.Value>
          </Setter>
        </Style>
      </GroupStyle.ContainerStyle>
    </GroupStyle>
  </UserControl.Resources>
  <vw:SelectedEntityListView GroupStyle="{StaticResource ListGroupStyle}" />
</UserControl>